ZOOKEEPER-4391: Allow custom JVM heap sizing - #2460
jprieto-temporal wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Nice and simple concept, but I think the word "auto" is the wrong word to use. It appears to be chosen to manually configure JVM flags that affect automatic heap sizing. However, what it is actually doing is removing any automatically placed heap configuration fields. You can use that to add flags manually that do automatic heap sizing, but you can also use that to just omit those heap options for any other reason. With the word "auto", users may be confused that you need to set it to remove an automatic addition of heap options, so that you can use it (optionally) for different heap options.
So, I think something along the lines of "none", "skip", "custom", or "omit" should be used instead.
The instruction in the documention would then look something like:
Use `manual` to skip adding any heap options to the JVM environment automatically, so you can manually set any heap related flags yourself. For example:
```bash
ZK_SERVER_HEAP=omit \
SERVER_JVMFLAGS="-XX:InitialRAMPercentage=25 -XX:MaxRAMPercentage=75" \
./zkServer.sh start
```
or
```bash
ZK_SERVER_HEAP=omit \
SERVER_JVMFLAGS="-Xmx2g" \
./zkServer.sh start
```
|
@ctubbsii Thank you for the review. Yes, |
kezhuw
left a comment
There was a problem hiding this comment.
Great!
I think the word "auto" is the wrong word to use.
So, I think something along the lines of "none", "skip", "custom", or "omit" should be used instead.
Yes, auto was a confusing choice by me. I've updated to use the word omit and updated the docs as you suggested.
"ignore" could also be a candidate. I have no preference, but I think we should phrase the doc sentence carefully so we don't mislead users.
|
Hi @jprieto-temporal, do you have a jira account or would you mind register a jira account so I can assign ZOOKEEPER-4391 to you ? |
|
@kezhuw Thanks! Yes you can find me on jira by my name or username |
|
I think #2398 solves this problem in a bit simpler way |
Allow ZK_SERVER_HEAP and ZK_CLIENT_HEAP to use auto, which omits the generated -Xmx option. This enables settings such as -XX:MaxRAMPercentage through the existing JVM flags while preserving current defaults and numeric heap values.
Add a conf/java.env template and document the new behavior and update documentation.
I didn't follow the exact approach suggested in #2061 (review) because existing deployments may set JVMFLAGS for unrelated options while relying on ZooKeeper’s default heap limits. Removing the generated -Xmx in those cases would silently change their memory behavior. Using the explicit auto value makes the change opt-in.